<?php
require('../../lib/base.php');
$base=new base('web');
$cache=$base->cache(array('tag'=>'web.index','time'=>86400));
if($cache===false){
	$cache=$base->cache(array('tag'=>'web.header','time'=>86400));
	if($cache===false){
		$sort=$base->model('sort');
		$data['menu']=$sort->GSort(array('where'=>array('label='=>'IndexMenu','locked='=>0),'order'=>array('sequence'=>'ASC')));
		$base->cache(array('content'=>serialize($data['menu']),'tag'=>'web.header'));
	}else{
		$data['menu']=unserialize($cache);
	}
	$config=$base->model('config');
	$data['slide']=$config->GConfig(array('where'=>array('label='=>'slide'),'order'=>array('name'=>'ASC')));
	$cache=$base->cache(array('tag'=>'web.footer','time'=>86400));
	if($cache===false){
		$foot=reset($config->GConfig(array('where'=>array('label='=>'union','name='=>'foot'))));
		$base->cache(array('content'=>$foot['value'],'tag'=>'web.footer'));
		$data['foot']=$foot['value'];
	}else{
		$data['foot']=$cache;
	}
	$content=$base->model('content');
	$data['publish']=$content->GContent(array('order'=>array('date'=>'DESC'),'limit'=>array(0,10)));
	$base->set($data);
	$base->view('index.php',array('strip'=>false,'caching'=>true,'tag'=>'web.index'));
}else{
	echo $cache;
}
?>